# -*- coding: utf-8 -*-
import unittest
import numpy as np

class MyclassTest(unittest.TestCase):
    def setUp(self) -> None:
        '''
        测试之前的准备工作
        :return:
        '''
#        self.clac = MyClass(4,3)
        pass

    def tearDown(self) -> None:
        '''
        测试之后的收尾
        如关闭数据库
        :return:
        '''
        pass

    def test_npzero(self):
#        self.assertEqual(getright('1.5-3.5万/月'),35.0)
        print(np.zeros([3,3]))
        pass
    
    def test_nparray_sum(self):
        arr = np.array([[1,2],[4,5]])
        print(arr)
        print(np.sum(arr))
        pass
    
    def test_nparray_mul(self):
        arr1 = np.array([[1,2],[4,5]])
        arr2 = np.array([[1,2],[4,5]])
        print(arr1 * arr2)
        pass
    
    def test_nparray_cut(self):
        arr = np.array([[1,2,3],[4,5,6]])
        print(arr[0:2,0:2])
        pass
    
if __name__ == '__main__':
    suite = unittest.TestSuite()
#    suite.addTest(MyclassTest('test_npzero'))
#    suite.addTest(MyclassTest('test_nparray_sum'))
#    suite.addTest(MyclassTest('test_nparray_mul'))
    suite.addTest(MyclassTest('test_nparray_cut'))

    runner = unittest.TextTestRunner()
    runner.run(suite)

